package com.pg.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.pg.mapper.OrderMapper;
import com.pg.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;

/**
 * <p>
 * 订单类 服务实现类
 * </p>
 *
 * @author likl
 * @since 2020-07-06
 */
@Service
@DS("proxyDs")
@Primary
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public int selectDdCountByMap(HashMap<String, Object> orderMap) {
        String supplierCode = (String) orderMap.get("supplierCode");
        String subclassCode = (String) orderMap.get("subclassCode");
        Date startTime = (Date) orderMap.get("startTime");
        Date endTime = (Date) orderMap.get("endTime");
        return orderMapper.selectDdCountByMap(supplierCode, subclassCode, startTime, endTime);
    }
}
